home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{2C910558-3DA7-11D2-8B30-006097A8F11E}#1.0#0"; "MCSANITIZER.OCX" Begin VB.Form frmMCSanitizerDemo BorderStyle = 3 'Fixed Dialog Caption = "mcSanitizer : Demo" ClientHeight = 4980 ClientLeft = 45 ClientTop = 615 ClientWidth = 8835 Icon = "frmMCSanitizerDemo.frx":0000 MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 4980 ScaleWidth = 8835 StartUpPosition = 2 'CenterScreen Begin MC_Sanitizer.mcSanitizer mcSanitizer1 Left = 8190 Top = 4320 _ExtentX = 847 _ExtentY = 847 End Begin VB.Frame Frame3 Caption = "Sanitize in progress ..." Height = 1545 Left = 90 TabIndex = 21 Top = 3330 Width = 5235 Begin VB.Line Line1 BorderColor = &H00808080& X1 = 2475 X2 = 2475 Y1 = 180 Y2 = 1440 End Begin VB.Label lblTime Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Index = 2 Left = 4500 TabIndex = 36 Top = 1080 Width = 555 End Begin VB.Label lblTime Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Index = 1 Left = 4500 TabIndex = 34 Top = 720 Width = 555 End Begin VB.Label lblTime Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Index = 0 Left = 4500 TabIndex = 32 Top = 360 Width = 555 End Begin VB.Label Label5 AutoSize = -1 'True Caption = "Elapsed time step 3" Height = 195 Left = 2610 TabIndex = 35 Top = 1080 Width = 1380 End Begin VB.Label Label4 AutoSize = -1 'True Caption = "Elapsed time step 2" Height = 195 Left = 2610 TabIndex = 33 Top = 720 Width = 1380 End Begin VB.Label Label3 AutoSize = -1 'True Caption = "Elapsed time step 1" Height = 195 Left = 2610 TabIndex = 31 Top = 360 Width = 1380 End Begin VB.Label lblParts Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Left = 1800 TabIndex = 30 Top = 1080 Width = 555 End Begin VB.Label lblSteps Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Left = 1800 TabIndex = 27 Top = 720 Width = 555 End Begin VB.Label lblPassages Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Left = 1800 TabIndex = 24 Top = 360 Width = 555 End Begin VB.Label Label1 AutoSize = -1 'True Caption = "Passage" Height = 195 Index = 0 Left = 270 TabIndex = 22 Top = 360 Width = 615 End Begin VB.Label Label1 AutoSize = -1 'True Caption = "Step" Height = 195 Index = 1 Left = 270 TabIndex = 25 Top = 720 Width = 330 End Begin VB.Label Label1 AutoSize = -1 'True Caption = "Part" Height = 195 Index = 2 Left = 270 TabIndex = 28 Top = 1080 Width = 285 End Begin VB.Label lblPassage Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Left = 1170 TabIndex = 23 Top = 360 Width = 555 End Begin VB.Label lblStep Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Left = 1170 TabIndex = 26 Top = 720 Width = 555 End Begin VB.Label lblPart Alignment = 1 'Right Justify BorderStyle = 1 'Fixed Single Height = 285 Left = 1170 TabIndex = 29 Top = 1080 Width = 555 End End Begin VB.Frame Frame2 Caption = "&Configuration" Height = 3165 Left = 5400 TabIndex = 9 Top = 90 Width = 3345 Begin VB.CheckBox chkAutomatic Alignment = 1 'Right Justify Caption = "Use &automatic resize/rename/delete" Height = 285 Left = 270 TabIndex = 20 Top = 2700 Value = 1 'Checked Width = 2895 End Begin VB.ComboBox cmbMode Height = 315 ItemData = "frmMCSanitizerDemo.frx":030A Left = 2340 List = "frmMCSanitizerDemo.frx":0317 TabIndex = 17 Text = "3" Top = 1530 Width = 825 End Begin VB.CheckBox chkBuffers Alignment = 1 'Right Justify Caption = "Use &buffers" Height = 285 Left = 270 TabIndex = 18 Top = 1980 Width = 2895 End Begin VB.ComboBox cmbPassages Height = 315 ItemData = "frmMCSanitizerDemo.frx":0324 Left = 2340 List = "frmMCSanitizerDemo.frx":0349 TabIndex = 13 Text = "7" Top = 810 Width = 825 End Begin VB.TextBox txtChar Alignment = 1 'Right Justify Height = 285 Left = 2700 MaxLength = 1 TabIndex = 11 Text = "U" Top = 360 Width = 465 End Begin VB.CheckBox chkRandomPattern Alignment = 1 'Right Justify Caption = "Use same &random pattern" Height = 285 Left = 270 TabIndex = 19 Top = 2340 Value = 1 'Checked Width = 2895 End Begin VB.ComboBox cmbBufferSize Height = 315 ItemData = "frmMCSanitizerDemo.frx":0372 Left = 2340 List = "frmMCSanitizerDemo.frx":0391 TabIndex = 15 Text = "16384" Top = 1170 Width = 825 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "&Mode" Height = 195 Index = 7 Left = 270 TabIndex = 16 Top = 1620 Width = 465 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "&Passages" Height = 195 Index = 6 Left = 270 TabIndex = 12 Top = 810 Width = 735 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "&Char" Height = 195 Index = 5 Left = 270 TabIndex = 10 Top = 360 Width = 375 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "Buffer &size" Height = 195 Index = 4 Left = 270 TabIndex = 14 Top = 1260 Width = 735 End End Begin VB.Frame Frame1 Caption = "&Select a file" Height = 3165 Left = 90 TabIndex = 0 Top = 90 Width = 5235 Begin VB.TextBox txtFileName Height = 285 Left = 180 Locked = -1 'True TabIndex = 8 Top = 2700 Width = 4875 End Begin VB.FileListBox File1 Height = 1650 Left = 2430 TabIndex = 6 Top = 630 Width = 2625 End Begin VB.DirListBox Dir1 Height = 990 Left = 180 TabIndex = 4 Top = 1350 Width = 2175 End Begin VB.DriveListBox Drive1 Height = 315 Left = 180 TabIndex = 2 Top = 630 Width = 2175 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "Selected file" Height = 195 Index = 3 Left = 180 TabIndex = 7 Top = 2430 Width = 870 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "File" Height = 195 Index = 2 Left = 2430 TabIndex = 5 Top = 360 Width = 240 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "Directory" Height = 195 Index = 1 Left = 180 TabIndex = 3 Top = 1080 Width = 630 End Begin VB.Label Label2 AutoSize = -1 'True Caption = "Disk" Height = 195 Index = 0 Left = 180 TabIndex = 1 Top = 360 Width = 315 End End Begin VB.CommandButton Command1 Caption = "Sanitize" BeginProperty Font Name = "Arial" Size = 33.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 1455 Left = 5400 Picture = "frmMCSanitizerDemo.frx":03B0 Style = 1 'Graphical TabIndex = 37 Top = 3420 Width = 3345 End Begin VB.Menu mnu_Exit Caption = "E&xit" End Attribute VB_Name = "frmMCSanitizerDemo" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub Command1_Click() Command1.Enabled = False DoEvents Dim iStatus As Integer If (MsgBox("Are you sure to sanitize the file" & vbCrLf & vbCrLf & txtFileName.Text & " ?", vbYesNo, "mcSanitizer : Warning") = vbNo) Then File1.Refresh Command1.Enabled = True Exit Sub End If mcSanitizer1.filename = txtFileName.Text mcSanitizer1.Char = txtChar.Text mcSanitizer1.Passages = Val(cmbPassages.Text) mcSanitizer1.BufferSize = Val(cmbBufferSize.Text) mcSanitizer1.NewFileName = "" mcSanitizer1.UseBuffers = chkBuffers.Value mcSanitizer1.UseSameRandomPattern = chkRandomPattern.Value mcSanitizer1.Mode = Val(cmbMode.Text) mcSanitizer1.Automatic = chkAutomatic.Value lblPassages.Caption = mcSanitizer1.Passages lblSteps.Caption = mcSanitizer1.Mode lblParts.Caption = mcSanitizer1.Parts iStatus = mcSanitizer1.Sanitize If (iStatus <> True) Then MsgBox "An error has occured" & vbCrLf & _ "mcSanitizer code is " & iStatus & vbCrLf & _ "VB error number is " & mcSanitizer1.LastErrorNumber & vbCrLf & _ "VB error description is " & mcSanitizer1.LastErrorDescription End If lblTime(0).Caption = mcSanitizer1.TimeForChar lblTime(1).Caption = mcSanitizer1.TimeForCharComplement lblTime(2).Caption = mcSanitizer1.TimeForCharRandom If (mcSanitizer1.Automatic = False) Then If (MsgBox("Because you set the .Automatic property to False, " & vbCrLf & "you need to resize the file to zero length, " & vbCrLf & "then rename it and then delete it." & vbCrLf & vbCrLf & "Do you want the mcSanitizer does it (.Delete method) ?", vbYesNo) = vbYes) Then iStatus = mcSanitizer1.Delete If (iStatus <> True) Then MsgBox "An error has occured" & vbCrLf & _ "mcSanitizer code is " & iStatus & vbCrLf & _ "VB error number is " & mcSanitizer1.LastErrorNumber & vbCrLf & _ "VB error description is " & mcSanitizer1.LastErrorDescription End If End If End If File1.Refresh Command1.Enabled = True End Sub Private Sub Dir1_Change() File1.Path = Dir1.Path End Sub Private Sub Drive1_Change() Dir1.Path = Drive1.Drive End Sub Private Sub File1_Click() txtFileName.Text = Dir1.Path + "\" + File1.filename End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Unload frmMCSanitizerDemo End Sub Private Sub mcSanitizer1_BeginPassage(iPassage As Integer) lblPassage.Caption = iPassage lblStep.Caption = "0" lblPart.Caption = "0" DoEvents End Sub Private Sub mcSanitizer1_EndPassage(iPassage As Integer) lblPassage.Caption = iPassage DoEvents End Sub Private Sub mcSanitizer1_BeginStep(iPassage As Integer, iStep As Integer) lblStep.Caption = iStep DoEvents End Sub Private Sub mcSanitizer1_EndStep(iPassage As Integer, iStep As Integer) lblStep.Caption = iStep DoEvents End Sub Private Sub mcSanitizer1_BeginPart(iPassage As Integer, iStep As Integer, lPart As Long) lblPart.Caption = lPart DoEvents End Sub Private Sub mcSanitizer1_EndPart(iPassage As Integer, iStep As Integer, lPart As Long) lblPart.Caption = lPart DoEvents End Sub Private Sub mcSanitizer1_Error(iError As MC_Sanitizer.mcEnumError) MsgBox "An error has occured" & vbCrLf & _ "mcSanitizer code is " & iError & vbCrLf & _ "VB error number is " & mcSanitizer1.LastErrorNumber & vbCrLf & _ "VB error description is " & mcSanitizer1.LastErrorDescription, , "mcSanitizer : Error event" End Sub Private Sub mnu_Exit_Click() Unload frmMCSanitizerDemo End Sub